From 5fa5653209ff96a9ebd7e421eaee6d46edee69d1 Mon Sep 17 00:00:00 2001 From: Jehan Date: Sat, 2 Sep 2017 14:18:07 +0200 Subject: [PATCH] babl: use _aligned_malloc() instead of aligned_alloc() on Win32. Thanks to Lionel N. for raising the issue. It was failing to build for Windows with: > babl/babl-space.c:503: undefined reference to `aligned_alloc' Windows has apparently a similar API, except that the size and alignment parameters are inverted. See https://msdn.microsoft.com/library/8z34s9c6.aspx --- babl/babl-space.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/babl/babl-space.c b/babl/babl-space.c index 77fc1ec..23a1c3e 100644 --- a/babl/babl-space.c +++ b/babl/babl-space.c @@ -500,7 +500,11 @@ universal_nonlinear_rgba_u8_converter (const Babl *conversion,unsigned char *src uint8_t *rgba_in_u8 = (void*)src_char; uint8_t *rgba_out_u8 = (void*)dst_char; +#ifndef _WIN32 float *rgb = aligned_alloc (16, sizeof(float) * 4 * samples); +#else + float *rgb = _aligned_malloc (sizeof(float) * 4 * samples, 16); +#endif for (i = 0; i < samples; i++) { @@ -642,7 +646,11 @@ universal_nonlinear_rgba_u8_converter_sse2 (const Babl *conversion,unsigned char uint8_t *rgba_in_u8 = (void*)src_char; uint8_t *rgba_out_u8 = (void*)dst_char; +#ifndef _WIN32 float *rgb = aligned_alloc (16, sizeof(float) * 4 * samples); +#else + float *rgb = _aligned_malloc (sizeof(float) * 4 * samples, 16); +#endif for (i = 0; i < samples; i++) { -- 2.30.2